<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/common/taglib.jsp" %>

<div class="hs-panel">
	<div class="hs-panel-heading clearfix">
		<h4 class="pull-left"><span class="glyphicon glyphicon-list"></span> 用户</h4>
		<form id="a1" action="${admin}/system/user" class="form-inline pull-right" role="form">
			<div class="form-group">
				<label class="sr-only" for="search">查询</label>
				<input type="text" id="search" name="search" value="${param.search}" class="form-control input-sm" placeholder="查询">
			</div>
			<button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search"></span> 查询</button>
		</form>
	</div>
	<div class="hs-panel-body">
		<form action="" method="post" role="form">
			<a href="${admin}/system/user/create"><button type="button" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-plus"></span> 添加</button></a>
			<button type="submit" class="btn btn-default btn-sm hs-cf-deletes hs-multiple" formaction="${admin}/system/user/delete"><span class="glyphicon glyphicon-trash"></span> 删除</button>
			<table>
				<thead>
					<tr>
						<th><input type="checkbox" class="hs-check-idleader" /></th>
						<th>用户名</th>
						<th>密码</th>
						<th>年龄</th>
						<th>管理权限</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="user" items="${page.result}">
						<tr>
							<td><input type="checkbox" name="id" value="${user.id}" /></td>
							<td>${user.username}</td>
							<td>${user.password}</td>
							<td>${user.age}</td>
							<td>
								<c:choose>
							      	<c:when test="${user.role}">
								       	<span class="glyphicon glyphicon-ok"></span>
							        </c:when>
							        <c:otherwise>&nbsp;</c:otherwise>
						        </c:choose>
							</td>
							<td>
								<a href="${admin}/system/user/edit/${user.id}"><button type="button" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> 编辑</button></a>
								<a href="${admin}/system/user/delete?id=${user.id}" class="hs-cf-delete"><button type="button" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-trash"></span> 删除</button></a>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</form>
		<hs:pager />
	</div>
</div>